<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemNoticeAdminTable extends Migration
{
    /**
     * Run the migrations.
     *通知记录表
     * @return void
     */
    public function up()
    {
        Schema::create('system_notice_admin', function (Blueprint $table) {
            $table->id()->comment('通知记录表');
            $table->integer('link_id')->index()->comment('关联ID');
            $table->smallInteger('admin_id')->index()->comment('通知的管理员');
            $table->string('notice_type')->comment('通知类型');
            $table->text('table_data')->nullable()->comment('通知的数据');
            $table->tinyInteger('click')->comment('点击次数');
            $table->tinyInteger('visit')->comment('访问次数');
            $table->timestamp('visit_time')->comment('访问时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_notice_admin');
    }
}
